<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<!--{include file='comm/header.tpl'}-->
    <title>角色组列表</title>
</head>
<body>

<!--{include file='comm/naviBanner.tpl'}-->

<div class="container">

    <!--{include file='comm/menu.tpl'}-->

        <div class="comm_crub">
            <span class="now_crub">角色组列表</span>
        </div>

        <div class="comm_content">

            <table id="flex" style="display:none"></table>

        </div>


</div>

</body>
<script type="text/javascript">

	$("#flex").flexigrid({
        url:"/invokingAjax-backend/user/roleGroupList.ajax?operFlg=1&xjx=none",
        dataType: "json",
        colModel : [
            <!--{if $edit_permission}-->
            {display: "操作", width : 100, align: 'center'},
            <!--{/if}-->
            {display: "角色组ID", name : "roleGroupID" , width : 150 , sortable : true },
            {display: "角色组名称", width : 200},
            {display: "备注", width : 200}
        ],
        <!--{if $edit_permission}-->
        buttons : [
            {name: "添加", bclass: "add", onpress : "roleGroup.edit"},
            {separator: true},
            {name: "删除", bclass: "delete", onpress : "roleGroup.del.check"}
        ],
        <!--{/if}-->
        sortname: "roleGroupID",
        sortorder: "DESC",
        usepager: true,
        rp: 10,
        useRp: true,
        showTableToggleBtn: true
    });
		
	var roleGroup = {

		edit: {

            open: function(id) {

                var html = '';

            }

		},

		load: function(){
			$("#flex").flexReload();
		},

        del: {

            g_array: "",

            check: function() {

                this.g_array = new Array();

                //获取选中的行的行数
                var selected_count=$('.trSelected',flex).length;
                if (selected_count==0) {
                    E.alert('请选择要删除的角色组');
                } else {
                    for(var i=0; i<selected_count; i++){
                        var typeIDStr = $('.trSelected',flex).eq(i).attr('id');
                        this.g_array.push(typeIDStr.substr(3));
                    }
                    //弹出确认层
                    E.confirm('您确认删除选择的角色组吗？', "roleGroup.del.execute");
                }
            },

            execute: function() {
                E.ajax_get({
                    url: "/invokingAjax-backend/user/roleGroupList.ajax?operFlg=3",
                    data: {
                        r_g_array: this.g_array
                    },
                    call: "roleGroup.load"
                });
            }

        }
	};
</script>
</html>